<template>
	<div>
	<el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="tableData.page||page"
      :page-sizes="pageSizes"
      :page-size="tableData.rows||rows"
      layout="total, sizes, prev, pager, next, jumper"
      :total="tableData.total||total">
    </el-pagination>
    </div>
</template>
<script>
	//import pagination from 'config/pagination.js'
	export default {
	  name: 'pagination',
	  props:['tableData','pageData','searchForm'],
	  created(){ 
	  },
	  data() {
	  	return {
	  		page:1,
		    total:0,
		    pageSizes:[10, 20, 30, 40],
		    rows:10
	  	}
	  },

	  methods: { 
	    handleSizeChange(rows) {
	    	this.tableData.rows=rows;
	    	if(this.tableData.total>0){
	    		this.tableData.page=1;
	            this.$emit('refreshSeachData', this.searchForm);
			}  
	    	
	        //this.seachData();
	    },
	    handleCurrentChange(page) {
	    	this.tableData.page=page;
	        this.$emit('refreshSeachData', this.searchForm);
			//this.seachData();
			// console.dir(this.searchForm)
			
	    }
	  },
	  mounted(){
		  // console.dir(this.tableData)
	  }
	}
</script>